package com.grj.service.article.verify;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 14505
 */
@Component
public class VerifyFactory {

    @Resource
    private List<AbstractVerify> abstractVerify;

    @Bean
    public List<AbstractVerify> verifyList() {
        for (int i = 0; i < abstractVerify.size()-1; i++) {
            abstractVerify.get(i).setNext(abstractVerify.get(i+1));
        }
        return abstractVerify;
    }

    public void getVerify(String s){
        abstractVerify.get(0).toDo(s);
    }
}
